<?php
/**
 *
 * 外链跳转模块
 *
 *
 * This is NOT a freeware, use is subject to license terms
 *
 * @copyright Copyright (C) 2005 - 2099 Cenwor Inc.
 * @license http://www.cenwor.com
 * @link http://www.jishigou.net
 * @author 狐狸<foxis@qq.com>
 * @version $Id: url.mod.php 2862 2013-02-28 03:03:27Z wuliyong $
 */

if(!defined('IN_JISHIGOU')) {
    exit('invalid request');
}

class ModuleObject extends MasterObject {

	function ModuleObject($config) {
		$this->MasterObject($config);

		$this->redirect();
	}

	function redirect() {
		$key = $this->Code;
		if (!$key && strlen($key) < 1) {
			$this->Messager("错误的请求", null);
		}

		$url_info = jlogic('url')->get_info_by_key($key);

		if (!$url_info) {
			$this->Messager("[错误请求]不存在的链接地址", null);
		}

		jlogic('url')->set_open_times($url_info['id'], '+1');

				$this->Messager(null, $url_info['url']);
	}

}
?>
